package com.zlm.user.emp.controller;

import com.zlm.common.base.BaseController;
import com.zlm.common.dto.JsonResultDto;
import com.zlm.user.emp.service.OrgWorkTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 企业班制控制器
 * @Author: duyufu
 * @Date: 2019/5/27 9:48
 */
@RestController
@RequestMapping("/orgWorkTime")
public class OrgWorkTimeController extends BaseController {
    @Autowired
    private OrgWorkTimeService orgWorkTimeService;

    /**
     * 查询班制信息
     * @param empId
     * @return
     */
    @GetMapping("/queryOrgWorkTime")
    public JsonResultDto queryOrgWorkTime(Integer empId) {
        try {
            List<Map<String,Object>> workTimeList = orgWorkTimeService.queryOrgWorkTime(empId);
            return success(workTimeList);
        } catch (Exception e) {
            e.printStackTrace();
            return fail(e.getMessage());
        }
    }

}
